package com.blrs.service.honor.impl;

import java.sql.Timestamp;
import java.time.Instant;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.temporal.ChronoUnit;
import java.util.*;

import com.blrs.VO.EnterpriseHonorVO;
import com.blrs.VO.HonorIndex;
import com.blrs.common.constant.HttpStatus;
import com.blrs.common.core.domain.AjaxResult;
import com.blrs.common.core.domain.TreeSelect;
import com.blrs.common.core.domain.entity.SysDept;
import com.blrs.common.core.domain.entity.SysDictData;
import com.blrs.common.core.domain.entity.SysUser;
import com.blrs.common.core.page.TableDataInfo;
import com.blrs.common.utils.ReflectionUtils;
import com.blrs.common.utils.SecurityUtils;
import com.blrs.common.utils.StringUtils;
import com.blrs.common.utils.uuid.IdUtils;
import com.blrs.domain.CollaborativeManagement;
import com.blrs.domain.EnterpriseInfo;
import com.blrs.domain.HonorManagement;
import com.blrs.domain.vo.HonorPublicVO;
import com.blrs.mapper.CollaborativeManagementMapper;
import com.blrs.mapper.EnterpriseInfoMapper;
import com.blrs.mapper.SupplierInfoMapper;
import com.blrs.service.honor.IHonorManagementService;
import com.blrs.system.domain.SysUploadFile;
import com.blrs.system.mapper.SysDeptMapper;
import com.blrs.system.mapper.SysDictDataMapper;
import com.blrs.system.mapper.SysUploadFileMapper;
import com.blrs.system.mapper.SysUserMapper;
import com.sun.org.apache.bcel.internal.generic.NEW;
import jodd.io.upload.FileUpload;
import liquibase.pro.packaged.A;
import org.apache.poi.ss.formula.functions.Now;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.blrs.mapper.HonorManagementMapper;
import org.springframework.transaction.annotation.Transactional;

/**
 * 荣誉资质信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-18
 */
@Service
public class HonorManagementServiceImpl implements IHonorManagementService
 {
    @Autowired
    private HonorManagementMapper honorManagementMapper;
    @Autowired
    private EnterpriseInfoMapper enterpriseInfoMapper;
    @Autowired
    private SysUserMapper userMapper;
    @Autowired
    private SysUploadFileMapper sysUploadFileMapper;
    @Autowired
    private SysDeptMapper sysDeptMapper;
    @Autowired
    private SysDictDataMapper sysDictDataMapper;
    @Autowired
    private SupplierInfoMapper supplierInfoMapper;
    @Autowired
    private CollaborativeManagementMapper collaborativeManagementMapper;

    /**
     * 查询荣誉资质信息
     * 
     * @param id 荣誉资质信息主键
     * @return 荣誉资质信息
     */
    @Override
    public HonorManagement selectHonorManagementById(String id)
    {
        HonorManagement honorManagement = honorManagementMapper.selectHonorManagementById(id);
//        EnterpriseInfo enterpriseInfo = enterpriseInfoMapper.selectEnterpriseInfoByEnterpriseId(honorManagement.getCustomerId());
//        honorManagement.setEnterpriseName(enterpriseInfo.getEnterpriseName());
//        if (honorManagement.getUploadFile()!=null){
//            honorManagement.setFileUrl(sysUploadFileMapper.selectUrlByCode("honor",honorManagement.getUploadFile()));
//        }
        honorManagement.setCreateId(userMapper.selectUserById(Long.valueOf(honorManagement.getCreateId())).getUserName());
        return honorManagement;
    }

    /**
     * 查询荣誉资质信息列表
     * 
     * @param honorManagement 荣誉资质信息
     * @return 荣誉资质信息
     */
    @Override
    public List<HonorManagement> selectHonorManagementList(HonorManagement honorManagement)
    {
        if (Objects.nonNull(honorManagement.getCustomerId())){
            SysDept sysDept = sysDeptMapper.selectByDeptName(honorManagement.getEnterpriseName());
            List<CollaborativeManagement> collaborativeManagements=Collections.emptyList();
          if (Objects.nonNull(sysDept)){
              CollaborativeManagement collaborativeManagement = new CollaborativeManagement();
              collaborativeManagement.setOrgId(SecurityUtils.getOrgId().toString());
              collaborativeManagement.setNewId(sysDept.getDeptId().toString());
              collaborativeManagements= collaborativeManagementMapper.selectSetCollaborativeManagementInfo(collaborativeManagement);
          }
            if (SecurityUtils.getOrgId().equals(100L) || collaborativeManagements.size()>0){ //1.只有管理员才能查看客户管理我给他录入的以及和当前机构建立合作关系的
               if (Objects.nonNull(sysDept)){
                   //客户入驻了
                   honorManagement.setOrganizationId(sysDept.getDeptId());
               }
           } else {
               if (Objects.nonNull(sysDept)) {
                   //已入驻，但是没有建立合作关系（2024/1/23号，修改业务：在客户管理中，查看作为机构给客户录入的，以及客户自身的。但不包括别人给客户录入的（没接收））
                   honorManagement.setOrganizationId(SecurityUtils.getOrgId());
                   honorManagement.setDepartmentId(sysDept.getDeptId());//客户自身的企业id
                   honorManagement.setEnterpriseName(sysDept.getDeptName());

                  // honorManagement.setOrganizationName(SecurityUtils.getOrgName());
               }
           }
        }else {
            //说明是查询单独模块的荣誉资质，需查询自身插入的数据以及自身企业作为别人客户给我插入的荣誉资质信息
            if (Objects.isNull(honorManagement.getOrganizationId())){
                //企业信息转公海，需要根据企业id来查询，而不是查询当前组织的，所以需要判断一下
                honorManagement.setOrganizationId(SecurityUtils.getOrgId());
            }
            honorManagement.setEnterpriseName(SecurityUtils.getOrgName());
        }
        List<HonorManagement> honorManagements = honorManagementMapper.selectHonorManagementList(honorManagement);
        for (HonorManagement management : honorManagements) {
           if (management.getCreateId()!=null){
               management.setCreateId(userMapper.selectUserById(Long.valueOf(management.getCreateId())).getUserName());
           }
          if (management.getUploadFile()!=null){
              SysUploadFile uploadFile = new SysUploadFile();
              uploadFile.setBusinessId(management.getUploadFile());
              uploadFile.setBusinessCode("honor");
              List<SysUploadFile> sysUploadFiles = sysUploadFileMapper.selectSysUploadFileList(uploadFile);
             if (sysUploadFiles.size()>0){
                 management.setFileUrl(sysUploadFiles.get(0).getUrl());
             }
          }
          if (management.getOrganizationId().equals(SecurityUtils.getOrgId())){
              //相等，说明是自己公司录入
              management.setLuRu(true);
          }
          if (!SecurityUtils.getOrgId().equals(management.getOrganizationId()) && StringUtils.isNotEmpty(management.getCustomerId()) && SecurityUtils.getOrgName().equals(management.getEnterpriseName())){
              management.setReceive(true);
          }
//          //计算证书到期日
//            Date issuanceTime = management.getIssuanceTime();//证书到期日
//            Date currentTime = new Date(); // 获取当前时间
//            Instant currentInstant = currentTime.toInstant();
//            Instant expiryInstant = issuanceTime.toInstant();
//            LocalDate currentDate = LocalDateTime.ofInstant(currentInstant, ZoneId.systemDefault()).toLocalDate();
//            LocalDate expiryDate = LocalDateTime.ofInstant(expiryInstant, ZoneId.systemDefault()).toLocalDate();
//// 计算剩余月数
//            long monthsRemaining = ChronoUnit.MONTHS.between(currentDate.withDayOfMonth(1), expiryDate.withDayOfMonth(1));
//// 不足一个月按0个月算
//            if (monthsRemaining < 1) {
//                monthsRemaining = 0;
//            }
//            management.setEffectiveTime(String.valueOf(monthsRemaining));
            // 计算证书到期日
            Date issuanceTime = management.getIssuanceTime(); // 获取证书颁发时间
            Date currentTime = new Date(); // 获取当前时间
            Instant currentInstant = currentTime.toInstant();
            if (issuanceTime!= null){
                Instant expiryInstant = issuanceTime.toInstant();
                LocalDate currentDate = LocalDateTime.ofInstant(currentInstant, ZoneId.systemDefault()).toLocalDate();
                LocalDate expiryDate = LocalDateTime.ofInstant(expiryInstant, ZoneId.systemDefault()).toLocalDate();
                 // 计算剩余年数
                long yearsRemaining = ChronoUnit.YEARS.between(currentDate.withDayOfYear(1), expiryDate.withDayOfYear(1));
                // 不足一年按0年算
                if (yearsRemaining < 1) {
                    yearsRemaining = 0;
                }
                management.setEffectiveTime(String.valueOf(yearsRemaining));
            }else {
                management.setEffectiveTime("0");
            }

//            management.setFileUrl(sysUploadFileMapper.selectUrlByCode("honor",management.getUploadFile()));
        }
//        honorManagements.stream()
//                .peek(management -> {
//                    if (management.getCreateId() != null) {
//                        management.setCreateId(userMapper.selectUserById(Long.valueOf(management.getCreateId())).getUserName());
//                    }
//                    if (management.getUploadFile() != null) {
//                        management.setFileUrl(sysUploadFileMapper.selectUrlByCode("honor", management.getUploadFile()));
//                    }
//                    if (management.getOrganizationId().equals(SecurityUtils.getOrgId())) {
//                        management.setLuRu(true);
//                    }
//                    if (!SecurityUtils.getOrgId().equals(management.getOrganizationId()) && StringUtils.isNotEmpty(management.getCustomerId()) && SecurityUtils.getOrgName().equals(management.getEnterpriseName())) {
//                        management.setReceive(true);
//                    }
//                    Date issuanceTime = management.getIssuanceTime();//证书到期日
//                    Date currentTime = new Date(); // 获取当前时间
//                    Instant currentInstant = currentTime.toInstant();
//                    Instant expiryInstant = issuanceTime.toInstant();
//                    LocalDate currentDate = LocalDateTime.ofInstant(currentInstant, ZoneId.systemDefault()).toLocalDate();
//                    LocalDate expiryDate = LocalDateTime.ofInstant(expiryInstant, ZoneId.systemDefault()).toLocalDate();
//                    // 计算剩余月数
//                    long monthsRemaining = ChronoUnit.MONTHS.between(currentDate.withDayOfMonth(1), expiryDate.withDayOfMonth(1));
//                    // 不足一个月按0个月算
//                    if (monthsRemaining < 1) {
//                        monthsRemaining = 0;
//                    }
//                    management.setEffectiveTime(String.valueOf(monthsRemaining));
////                    management.setFileUrl(sysUploadFileMapper.selectUrlByCode("honor", management.getUploadFile()));
//                })
//                .collect(Collectors.toList());
        return honorManagements;
    }

     @Override
     public List<HonorManagement> selectHonorManagementListIndex(HonorManagement honorManagement) {
         List<HonorManagement> honorManagements = this.selectHonorManagementList(honorManagement);
         return changeWarn(honorManagements);
     }

     /**
      * 导入荣誉资质信息
      * @param list
      * @return
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String importExcel(List<HonorManagement> list) {
         for (HonorManagement honorManagement : list) {
             honorManagement.setOperateTime(new Timestamp(new Date().getTime()));
             honorManagement.setCreationTime(new Timestamp(new Date().getTime()));
             honorManagement.setOrganizationId(796L);
             honorManagement.setOrganizationName("湖南省环通企业管理咨询有限公司");
             honorManagement.setCreateId(SecurityUtils.getUserId().toString());
             honorManagement.setEnterpriseName(honorManagement.getEnterpriseName());
             honorManagement.setCustomerId(enterpriseInfoMapper.selectEnterpriseInfoNameAndOrgIdAndDelFlag(honorManagement.getEnterpriseName(),796L).getEnterpriseId());
             honorManagement.setIsHuantong(String.valueOf(796L));
             honorManagement.setDepartmentId(796L);
             honorManagement.setId(IdUtils.fastUUID());
            honorManagementMapper.insertHonorManagement(honorManagement);
         }

         return "导入成功";
     }

     /**
      * 公海导入荣誉资质信息
      * @param list
      * @return
      */
     @Override
     @Transactional(rollbackFor = Exception.class)
     public String importExcelSeas(List<HonorManagement> list) {
         for (HonorManagement honorManagement : list) {
             honorManagement.setOperateTime(new Timestamp(new Date().getTime()));
             honorManagement.setCreationTime(new Timestamp(new Date().getTime()));
             honorManagement.setOrganizationId(796L);
             honorManagement.setOrganizationName("湖南省环通企业管理咨询有限公司");
             honorManagement.setCreateId("1485");
             honorManagement.setEnterpriseName(honorManagement.getEnterpriseName());
             honorManagement.setCustomerId(enterpriseInfoMapper.selectSeasEnterpriseNameAndOrgIdAndDelFlag(honorManagement.getEnterpriseName(),796L).getEnterpriseId());
             honorManagement.setIsHuantong(String.valueOf(796L));
             honorManagement.setDepartmentId(796L);
             honorManagement.setId(IdUtils.fastUUID());
             honorManagementMapper.insertHonorManagement(honorManagement);
         }
         return "导入成功";
     }

     @Override
     public int updateHonorStatus(HonorPublicVO honorManagement) {
      return    honorManagementMapper.updateHonorManagementStatus(honorManagement.getId(),honorManagement.getIsPublic());
     }

     @Override
     public List<SysUploadFile> selectHonorManagementListPublic() {
         List<HonorManagement> honorManagements = honorManagementMapper.selectHonorManagementListPublic(SecurityUtils.getOrgId());
         List<SysUploadFile> uploadFiles = new ArrayList<SysUploadFile>();
         for (HonorManagement honorManagement : honorManagements) {
             SysUploadFile sysUploadFile = new SysUploadFile();
             sysUploadFile.setBusinessId(honorManagement.getUploadFile());
             sysUploadFile.setBusinessCode("honor");
             List<SysUploadFile> sysUploadFiles = sysUploadFileMapper.selectSysUploadFileList(sysUploadFile);
             // 将每次查到的所有文件都加入总集合
             if (sysUploadFiles != null && !sysUploadFiles.isEmpty()) {
                 uploadFiles.addAll(sysUploadFiles);
             }
         }
         return uploadFiles;
     }

     @Override
     public String checkSync(String projectId) {
         return honorManagementMapper.checkSync(projectId, SecurityUtils.getOrgId());
     }

     @Override
     public int selectEnterpriseType(String id) {
         //根据id查询当前企业中客户管理是否存在改数据
         EnterpriseInfo enterpriseInfo = new EnterpriseInfo();
         enterpriseInfo.setEnterpriseId(id);
         enterpriseInfo.setDelFlag("0");
         enterpriseInfo.setBelongTo(SecurityUtils.getOrgId().toString());
         int count=enterpriseInfoMapper.selectEnterpriseInfoByEnterpriseIdCount(id);
         return count;
     }



     public static List<HonorManagement> changeWarn(List<HonorManagement> honorManagements) {
         ArrayList<HonorManagement> managementArrayList = new ArrayList<>();
         for (HonorManagement honorManagement : honorManagements) {
             Date currentDate = new Date();
             Date abutmentTime = honorManagement.getAbutmentTime();
             // 计算毫秒级的时间差
             long timeDifference = abutmentTime.getTime() - currentDate.getTime();
             // 将毫秒转换为天数
             long daysDifference = timeDifference / (1000 * 60 * 60 * 24);

             // 如果时间差小于3个月（约90天），返回橙色，否则返回空字符串
             if (daysDifference < 90) {
                 managementArrayList.add(honorManagement);
             }
         }
         return managementArrayList;
     }

     @Override
     public List selectHonorManagementListAll(HonorManagement honorManagement) {
         List<HonorManagement> honorManagements = selectHonorManagementListByOrgId(honorManagement);
         for (HonorManagement management : honorManagements) {
             if (management.getUploadFile()!=null){
                 management.setFileUrl(sysUploadFileMapper.selectUrlByCode("honor",management.getUploadFile()));
             }
         }
         List<Object> list = new ArrayList<>();
         Map<String,Object> map = new HashMap<>();
         map.put("listitem",honorManagements);
         list.add(map);
         return list;
     }

     @Override
     public List<HonorManagement> selectHonorManagementListByOrgId(HonorManagement honorManagement) {
         List<HonorManagement> honorManagements = honorManagementMapper.selectHonorManagementListByOrgId(honorManagement);
         for (HonorManagement management : honorManagements) {
             if (management.getUploadFile()!=null){
                 management.setFileUrl(sysUploadFileMapper.selectUrlByCode("honor",management.getUploadFile()));
             }
         }
         return honorManagements;
     }

     /**
     * 新增荣誉资质信息
     * 
     * @param honorManagement 荣誉资质信息
     * @return 结果
     */
    @Override
    public int insertHonorManagement(HonorManagement honorManagement) throws NoSuchFieldException, IllegalAccessException {
        ReflectionUtils.setCommonPrivateProperty(honorManagement);
        honorManagement.setOrganizationId(SecurityUtils.getOrgId());
        honorManagement.setOrganizationName(SecurityUtils.getOrgName());
        honorManagement.setId(IdUtils.fastUUID());
        honorManagement.setCreationTime(new Timestamp(new Date().getTime()));
        SysUser sysUser = userMapper.selectUserByUserName(honorManagement.getCreateId());
        honorManagement.setCreateId(String.valueOf(sysUser.getUserId()));
        if (StringUtils.isNotEmpty(honorManagement.getCustomerId())){
            honorManagement.setIsHuantong(String.valueOf(SecurityUtils.getOrgId()));
        }
        //如果客户id不为null,为了避免网络问题，进行查询企业名称
        if (StringUtils.isNotEmpty(honorManagement.getCustomerId()) && StringUtils.isEmpty(honorManagement.getEnterpriseName())){
            honorManagement.setEnterpriseName(enterpriseInfoMapper.selectEnterpriseInfoNameById(honorManagement.getCustomerId()));
        }
        return honorManagementMapper.insertHonorManagement(honorManagement);
    }

    /**
     * 修改荣誉资质信息
     * 
     * @param honorManagement 荣誉资质信息
     * @return 结果
     */
    @Override
    public int updateHonorManagement(HonorManagement honorManagement)
    {
        honorManagement.setOperateTime(new Date());
        //如果客户id不为null,为了避免网络问题，进行查询企业名称
        if (StringUtils.isNotEmpty(honorManagement.getCustomerId()) && StringUtils.isEmpty(honorManagement.getEnterpriseName())){
            honorManagement.setEnterpriseName(enterpriseInfoMapper.selectEnterpriseInfoNameById(honorManagement.getCustomerId()));
        }
        return honorManagementMapper.updateHonorManagement(honorManagement);
    }

    /**
     * 批量删除荣誉资质信息
     * 
     * @param ids 需要删除的荣誉资质信息主键
     * @return 结果
     */
    @Override
    public int deleteHonorManagementByIds(String[] ids)
    {
        return honorManagementMapper.deleteHonorManagementByIds(ids);
    }

    /**
     * 删除荣誉资质信息信息
     * 
     * @param id 荣誉资质信息主键
     * @return 结果
     */
    @Override
    public int deleteHonorManagementById(String id)
    {
        return honorManagementMapper.deleteHonorManagementById(id);
    }

     @Override
     public AjaxResult selectHonorManagementByType() {
         List<SysDictData> list = sysDictDataMapper.selectDictDataByType("certificate_type");
         ArrayList<TreeSelect> treeSelects = new ArrayList<>();
         for (SysDictData sysDictData : list) {
             TreeSelect treeSelect = new TreeSelect();
             treeSelect.setLabel(sysDictData.getDictLabel());
             treeSelect.setId(sysDictData.getDictSort());
             treeSelects.add(treeSelect);
         }
         //先创建一个父节点
         ArrayList<TreeSelect> treeSelects1 = new ArrayList<>();
         TreeSelect parentTree = new TreeSelect();
         parentTree.setId(1L);
         parentTree.setChildren(treeSelects);
         parentTree.setLabel("证书类别");
         treeSelects1.add(parentTree);
         return AjaxResult.success(treeSelects1);
     }
     @Override
     @Transactional(rollbackFor = Exception.class)
     public int updateReceiveHonor(String id) {
         HonorManagement honorManagement = new HonorManagement();
         honorManagement.setOrganizationId(SecurityUtils.getOrgId());
         honorManagement.setOperateId(SecurityUtils.getUserId());
         honorManagement.setDepartmentId(SecurityUtils.getDeptId());
         honorManagement.setCreateId(String.valueOf(SecurityUtils.getUserId()));
         honorManagement.setId(id);
          int i=honorManagementMapper.updateHonorManagementByReceive(honorManagement);
         return i;
     }

     @Override
     public List selectHonorManagementByTypeList() {
         List<SysDictData> list = sysDictDataMapper.selectDictDataByType("certificate_type");
         SysDictData sysDictData = new SysDictData();
         sysDictData.setDictLabel("全部");
         list.add(0,sysDictData);
         return list;
     }

     @Override
     public TableDataInfo selectHonorManagementByTypeUrlList(HonorManagement honorManagement) {
         List<HonorManagement> honorManagements = honorManagementMapper.selectHonorManagementList(honorManagement);
         for (HonorManagement management : honorManagements) {
             if (management.getUploadFile()!=null){
                 management.setFileUrl(sysUploadFileMapper.selectUrlByCode("honor",management.getUploadFile()));
             }
         }
         honorManagements.removeIf(management -> management.getFileUrl()==null);
         //创建一个集合
         List<HonorIndex> list=new ArrayList<>();
         HonorIndex honorIndex = new HonorIndex();
         for (int i = 0; i < honorManagements.size(); i++) {
             honorIndex.getList().add(honorManagements.get(i));
             if (honorIndex.getList().size() == 6 || i == honorManagements.size() - 1) {
                 list.add(honorIndex);
                 honorIndex = new HonorIndex();
             }
         }
         TableDataInfo rspData = new TableDataInfo();
         rspData.setCode(HttpStatus.SUCCESS);
         rspData.setMsg("查询成功");
         rspData.setRows(list);
         rspData.setTotal(honorManagements.size());
         return rspData;
     }

     /**
      * 查询当前服务机构和园区所有的客户和合作商所携带的荣誉资质记录
      * @param enterpriseHonorVO
      * @return
      */
//     @Override
     public List selectHonorEnterPriseList(EnterpriseHonorVO enterpriseHonorVO) {
         List<HonorManagement> combinedList = new ArrayList<>();

          if (enterpriseHonorVO.getSelectHonor().equals("0")){
              //只查询当前登录企业录入的荣誉资质证书
              enterpriseHonorVO.setOrgId(SecurityUtils.getOrgId());
              //2025.6.24  甲方要求只查询客户管理相关的荣誉资质数据；可查看群消息
              combinedList=honorManagementMapper.selectHuanTongList(enterpriseHonorVO);
              combinedList.forEach(honorManagement -> honorManagement.setIsHuantong(SecurityUtils.getOrgName()));
          }else {
              //根据组织机构查询所有客户信息(企业自身录入的)
              enterpriseHonorVO.setOrgId(SecurityUtils.getOrgId());
              List<HonorManagement> list=honorManagementMapper.selectEnterpriseInfoByBelongTo(enterpriseHonorVO);
              //别人给企业录入的
              List<HonorManagement> list1=honorManagementMapper.selectHonorManagementByEnter(enterpriseHonorVO);
              combinedList.addAll(list);
              combinedList.addAll(list1);
              //这里先设置：如果不是环通录入的，则证书的服务机构都为组织机构名称
              combinedList.forEach(honorManagement -> honorManagement.setIsHuantong(honorManagement.getOrganizationName()));
          }

         return combinedList;
     }

     @Override
     public List<HonorManagement> selectCooperationList(EnterpriseHonorVO enterpriseHonorVO) {
         List<Long> orgList=supplierInfoMapper.selectSupplierInfoListByOrg(SecurityUtils.getOrgId());
          if (StringUtils.isEmpty(orgList)){
              return Collections.emptyList();
          }
         enterpriseHonorVO.setOrgIds(orgList);
                return   honorManagementMapper.selectHonorManagementListByOrgIdShangJi(enterpriseHonorVO);
     }

     @Override
     public List<HonorManagement> selectPinTaiList(EnterpriseHonorVO enterpriseHonorVO) {
         List<Long> orgList=supplierInfoMapper.selectSupplierInfoListByOrgPla(SecurityUtils.getOrgId());
         if (StringUtils.isEmpty(orgList)){
             return Collections.emptyList();
         }
         enterpriseHonorVO.setOrgIds(orgList);
         return   honorManagementMapper.selectHonorManagementListByOrgIdShangJi(enterpriseHonorVO);
     }



 }
